﻿<?php



if($_GET['a']=='del'){
		$obj=new mysql($config);
		$sql="select img from `news` where `id`={$_GET['id']}";
		$date=$obj->getOne($sql);
		if(!empty($date['img'])){
			unlink($date['img']); 
		}

		// print_r($date);die();


		$num=$obj->delete(array('id'=>$_GET['id']),'news');


		if($num>0){
			echo '<script>alert("删除成功");location.href="news_list.php";</script>';
		}else{
			echo '<script>alert("删除失败");location.href="news_list.php";</script>';
		}

}
